var pattern = new RegExp('\\w+', 'i');
console.log(
	pattern.global,
	pattern.ignoreCase,
	pattern.multiline,
	pattern.source
);

pattern = /\w/g;
while (pattern.test('a1')) {
	console.log(pattern.lastIndex);
}
console.log(pattern.lastIndex);

var re = /w+/;

var str = "Hello World";
var pat = /hello/i;
console.log(
	str.match(pat),
	pat.test(str),
	pat.exec(str)
);
console.log(
	str.match(/l/g),
	str.match('l'),
	str.search('/h\w/i')
);

var url = /(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/;
var num = /^[0-9]*$/;
var mail = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
var ch = /[\u3000-\u301e\ufe10-\ufe19\ufe30-\ufe44\ufe50-\ufe6b\uff01-\uffee]/;
var id = /\d{15}(\d\d[0-9xX])?/;
var en = /^[A-Za-z]+$/;
var pos_int = /^\d+$/;
var neg_int = /^((-\d+)|(0+))$/;
var digit = /^(\-|\+)?\d+(\.\d+)?$/;
var ip = /^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$/;

var src = 'a1b2c3d4'
console.log(
	src.split(/\d/),
	src.replace(/\d/, function (match, index, origin) {
		return parseInt(match) + 1;
	})
);
